3.2.69 \(\int (a+b \sec (c+d x)) \sin ^4(c+d x) \, dx\) [169]

3.2.69.1 Optimal result
3.2.69.2 Mathematica [A] (verified)
3.2.69.3 Rubi [A] (verified)
3.2.69.4 Maple [A] (verified)
3.2.69.5 Fricas [A] (verification not implemented)
3.2.69.6 Sympy [F]
3.2.69.7 Maxima [A] (verification not implemented)
3.2.69.8 Giac [B] (verification not implemented)
3.2.69.9 Mupad [B] (verification not implemented)

3.2.69.1 Optimal result

Integrand size = 19, antiderivative size = 89 \[ \int (a+b \sec (c+d x)) \sin ^4(c+d x) \, dx=\frac {3 a x}{8}+\frac {b \text {arctanh}(\sin (c+d x))}{d}-\frac {b \sin (c+d x)}{d}-\frac {3 a \cos (c+d x) \sin (c+d x)}{8 d}-\frac {b \sin ^3(c+d x)}{3 d}-\frac {a \cos (c+d x) \sin ^3(c+d x)}{4 d} \]

output
3/8*a*x+b*arctanh(sin(d*x+c))/d-b*sin(d*x+c)/d-3/8*a*cos(d*x+c)*sin(d*x+c) 
/d-1/3*b*sin(d*x+c)^3/d-1/4*a*cos(d*x+c)*sin(d*x+c)^3/d
 
3.2.69.2 Mathematica [A] (verified)

Time = 0.17 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.97 \[ \int (a+b \sec (c+d x)) \sin ^4(c+d x) \, dx=\frac {3 a (c+d x)}{8 d}+\frac {b \text {arctanh}(\sin (c+d x))}{d}-\frac {b \sin (c+d x)}{d}-\frac {b \sin ^3(c+d x)}{3 d}-\frac {a \sin (2 (c+d x))}{4 d}+\frac {a \sin (4 (c+d x))}{32 d} \]

input
Integrate[(a + b*Sec[c + d*x])*Sin[c + d*x]^4,x]
 
output
(3*a*(c + d*x))/(8*d) + (b*ArcTanh[Sin[c + d*x]])/d - (b*Sin[c + d*x])/d - 
 (b*Sin[c + d*x]^3)/(3*d) - (a*Sin[2*(c + d*x)])/(4*d) + (a*Sin[4*(c + d*x 
)])/(32*d)
 
3.2.69.3 Rubi [A] (verified)

Time = 0.50 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.98, number of steps used = 15, number of rules used = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.737, Rules used = {3042, 4360, 25, 25, 3042, 3317, 3042, 3072, 254, 2009, 3115, 3042, 3115, 24}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sin ^4(c+d x) (a+b \sec (c+d x)) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \cos \left (c+d x-\frac {\pi }{2}\right )^4 \left (a-b \csc \left (c+d x-\frac {\pi }{2}\right )\right )dx\)

\(\Big \downarrow \) 4360

\(\displaystyle \int -\left (\sin ^3(c+d x) \tan (c+d x) (-a \cos (c+d x)-b)\right )dx\)

\(\Big \downarrow \) 25

\(\displaystyle -\int -\left ((b+a \cos (c+d x)) \sin ^3(c+d x) \tan (c+d x)\right )dx\)

\(\Big \downarrow \) 25

\(\displaystyle \int \sin ^3(c+d x) \tan (c+d x) (a \cos (c+d x)+b)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\cos \left (c+d x+\frac {\pi }{2}\right )^4 \left (a \sin \left (c+d x+\frac {\pi }{2}\right )+b\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx\)

\(\Big \downarrow \) 3317

\(\displaystyle a \int \sin ^4(c+d x)dx+b \int \sin ^3(c+d x) \tan (c+d x)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle a \int \sin (c+d x)^4dx+b \int \sin (c+d x)^3 \tan (c+d x)dx\)

\(\Big \downarrow \) 3072

\(\displaystyle a \int \sin (c+d x)^4dx+\frac {b \int \frac {\sin ^4(c+d x)}{1-\sin ^2(c+d x)}d\sin (c+d x)}{d}\)

\(\Big \downarrow \) 254

\(\displaystyle a \int \sin (c+d x)^4dx+\frac {b \int \left (-\sin ^2(c+d x)+\frac {1}{1-\sin ^2(c+d x)}-1\right )d\sin (c+d x)}{d}\)

\(\Big \downarrow \) 2009

\(\displaystyle a \int \sin (c+d x)^4dx+\frac {b \left (\text {arctanh}(\sin (c+d x))-\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}\)

\(\Big \downarrow \) 3115

\(\displaystyle a \left (\frac {3}{4} \int \sin ^2(c+d x)dx-\frac {\sin ^3(c+d x) \cos (c+d x)}{4 d}\right )+\frac {b \left (\text {arctanh}(\sin (c+d x))-\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}\)

\(\Big \downarrow \) 3042

\(\displaystyle a \left (\frac {3}{4} \int \sin (c+d x)^2dx-\frac {\sin ^3(c+d x) \cos (c+d x)}{4 d}\right )+\frac {b \left (\text {arctanh}(\sin (c+d x))-\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}\)

\(\Big \downarrow \) 3115

\(\displaystyle a \left (\frac {3}{4} \left (\frac {\int 1dx}{2}-\frac {\sin (c+d x) \cos (c+d x)}{2 d}\right )-\frac {\sin ^3(c+d x) \cos (c+d x)}{4 d}\right )+\frac {b \left (\text {arctanh}(\sin (c+d x))-\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}\)

\(\Big \downarrow \) 24

\(\displaystyle a \left (\frac {3}{4} \left (\frac {x}{2}-\frac {\sin (c+d x) \cos (c+d x)}{2 d}\right )-\frac {\sin ^3(c+d x) \cos (c+d x)}{4 d}\right )+\frac {b \left (\text {arctanh}(\sin (c+d x))-\frac {1}{3} \sin ^3(c+d x)-\sin (c+d x)\right )}{d}\)

input
Int[(a + b*Sec[c + d*x])*Sin[c + d*x]^4,x]
 
output
(b*(ArcTanh[Sin[c + d*x]] - Sin[c + d*x] - Sin[c + d*x]^3/3))/d + a*(-1/4* 
(Cos[c + d*x]*Sin[c + d*x]^3)/d + (3*(x/2 - (Cos[c + d*x]*Sin[c + d*x])/(2 
*d)))/4)
 

3.2.69.3.1 Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 254
Int[(x_)^(m_)/((a_) + (b_.)*(x_)^2), x_Symbol] :> Int[PolynomialDivide[x^m, 
 a + b*x^2, x], x] /; FreeQ[{a, b}, x] && IGtQ[m, 3]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3072
Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_ 
Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f   Subst[Int[ 
(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, a*(Sin[e + f*x]/ff)], x 
]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]
 

rule 3115
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n)   Int[(b*Sin 
[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 
2*n]
 

rule 3317
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n 
_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[a   Int[(g*Co 
s[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Simp[b/d   Int[(g*Cos[e + f*x])^ 
p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]
 

rule 4360
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_))^(m_.), x_Symbol] :> Int[(g*Cos[e + f*x])^p*((b + a*Sin[e + f*x])^m/Si 
n[e + f*x]^m), x] /; FreeQ[{a, b, e, f, g, p}, x] && IntegerQ[m]
 
3.2.69.4 Maple [A] (verified)

Time = 1.73 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.85

method result size
derivativedivides \(\frac {a \left (-\frac {\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+b \left (-\frac {\sin \left (d x +c \right )^{3}}{3}-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) \(76\)
default \(\frac {a \left (-\frac {\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+b \left (-\frac {\sin \left (d x +c \right )^{3}}{3}-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) \(76\)
parts \(\frac {a \left (-\frac {\left (\sin \left (d x +c \right )^{3}+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d}+\frac {b \left (-\frac {\sin \left (d x +c \right )^{3}}{3}-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) \(78\)
parallelrisch \(\frac {36 a x d -120 \sin \left (d x +c \right ) b +3 a \sin \left (4 d x +4 c \right )-24 a \sin \left (2 d x +2 c \right )+96 b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-96 b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+8 \sin \left (3 d x +3 c \right ) b}{96 d}\) \(87\)
risch \(\frac {3 a x}{8}+\frac {5 i b \,{\mathrm e}^{i \left (d x +c \right )}}{8 d}-\frac {5 i b \,{\mathrm e}^{-i \left (d x +c \right )}}{8 d}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {a \sin \left (4 d x +4 c \right )}{32 d}+\frac {b \sin \left (3 d x +3 c \right )}{12 d}-\frac {a \sin \left (2 d x +2 c \right )}{4 d}\) \(120\)
norman \(\frac {\frac {3 a x}{8}+\frac {3 a x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{2}+\frac {9 a x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{4}+\frac {3 a x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{2}+\frac {3 a x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{8}+\frac {\left (3 a -8 b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{4 d}-\frac {\left (3 a +8 b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (33 a -104 b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{12 d}-\frac {\left (33 a +104 b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{12 d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{4}}+\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) \(208\)

input
int((a+b*sec(d*x+c))*sin(d*x+c)^4,x,method=_RETURNVERBOSE)
 
output
1/d*(a*(-1/4*(sin(d*x+c)^3+3/2*sin(d*x+c))*cos(d*x+c)+3/8*d*x+3/8*c)+b*(-1 
/3*sin(d*x+c)^3-sin(d*x+c)+ln(sec(d*x+c)+tan(d*x+c))))
 
3.2.69.5 Fricas [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.89 \[ \int (a+b \sec (c+d x)) \sin ^4(c+d x) \, dx=\frac {9 \, a d x + 12 \, b \log \left (\sin \left (d x + c\right ) + 1\right ) - 12 \, b \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (6 \, a \cos \left (d x + c\right )^{3} + 8 \, b \cos \left (d x + c\right )^{2} - 15 \, a \cos \left (d x + c\right ) - 32 \, b\right )} \sin \left (d x + c\right )}{24 \, d} \]

input
integrate((a+b*sec(d*x+c))*sin(d*x+c)^4,x, algorithm="fricas")
 
output
1/24*(9*a*d*x + 12*b*log(sin(d*x + c) + 1) - 12*b*log(-sin(d*x + c) + 1) + 
 (6*a*cos(d*x + c)^3 + 8*b*cos(d*x + c)^2 - 15*a*cos(d*x + c) - 32*b)*sin( 
d*x + c))/d
 
3.2.69.6 Sympy [F]

\[ \int (a+b \sec (c+d x)) \sin ^4(c+d x) \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right ) \sin ^{4}{\left (c + d x \right )}\, dx \]

input
integrate((a+b*sec(d*x+c))*sin(d*x+c)**4,x)
 
output
Integral((a + b*sec(c + d*x))*sin(c + d*x)**4, x)
 
3.2.69.7 Maxima [A] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.91 \[ \int (a+b \sec (c+d x)) \sin ^4(c+d x) \, dx=\frac {3 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) - 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a - 16 \, {\left (2 \, \sin \left (d x + c\right )^{3} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right ) + 6 \, \sin \left (d x + c\right )\right )} b}{96 \, d} \]

input
integrate((a+b*sec(d*x+c))*sin(d*x+c)^4,x, algorithm="maxima")
 
output
1/96*(3*(12*d*x + 12*c + sin(4*d*x + 4*c) - 8*sin(2*d*x + 2*c))*a - 16*(2* 
sin(d*x + c)^3 - 3*log(sin(d*x + c) + 1) + 3*log(sin(d*x + c) - 1) + 6*sin 
(d*x + c))*b)/d
 
3.2.69.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 172 vs. \(2 (81) = 162\).

Time = 0.30 (sec) , antiderivative size = 172, normalized size of antiderivative = 1.93 \[ \int (a+b \sec (c+d x)) \sin ^4(c+d x) \, dx=\frac {9 \, {\left (d x + c\right )} a + 24 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 24 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (9 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 33 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 104 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 33 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 104 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4}}}{24 \, d} \]

input
integrate((a+b*sec(d*x+c))*sin(d*x+c)^4,x, algorithm="giac")
 
output
1/24*(9*(d*x + c)*a + 24*b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 24*b*log(a 
bs(tan(1/2*d*x + 1/2*c) - 1)) + 2*(9*a*tan(1/2*d*x + 1/2*c)^7 - 24*b*tan(1 
/2*d*x + 1/2*c)^7 + 33*a*tan(1/2*d*x + 1/2*c)^5 - 104*b*tan(1/2*d*x + 1/2* 
c)^5 - 33*a*tan(1/2*d*x + 1/2*c)^3 - 104*b*tan(1/2*d*x + 1/2*c)^3 - 9*a*ta 
n(1/2*d*x + 1/2*c) - 24*b*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 + 
1)^4)/d
 
3.2.69.9 Mupad [B] (verification not implemented)

Time = 14.54 (sec) , antiderivative size = 267, normalized size of antiderivative = 3.00 \[ \int (a+b \sec (c+d x)) \sin ^4(c+d x) \, dx=\frac {3\,a\,\mathrm {atan}\left (\frac {27\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,\left (\frac {27\,a^3}{8}+24\,a\,b^2\right )}+\frac {24\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\frac {27\,a^3}{8}+24\,a\,b^2}\right )}{4\,d}+\frac {2\,b\,\mathrm {atanh}\left (\frac {64\,b^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{9\,a^2\,b+64\,b^3}+\frac {9\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{9\,a^2\,b+64\,b^3}\right )}{d}-\frac {\left (2\,b-\frac {3\,a}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {26\,b}{3}-\frac {11\,a}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (\frac {11\,a}{4}+\frac {26\,b}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (\frac {3\,a}{4}+2\,b\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]

input
int(sin(c + d*x)^4*(a + b/cos(c + d*x)),x)
 
output
(3*a*atan((27*a^3*tan(c/2 + (d*x)/2))/(8*(24*a*b^2 + (27*a^3)/8)) + (24*a* 
b^2*tan(c/2 + (d*x)/2))/(24*a*b^2 + (27*a^3)/8)))/(4*d) + (2*b*atanh((64*b 
^3*tan(c/2 + (d*x)/2))/(9*a^2*b + 64*b^3) + (9*a^2*b*tan(c/2 + (d*x)/2))/( 
9*a^2*b + 64*b^3)))/d - (tan(c/2 + (d*x)/2)*((3*a)/4 + 2*b) - tan(c/2 + (d 
*x)/2)^7*((3*a)/4 - 2*b) + tan(c/2 + (d*x)/2)^3*((11*a)/4 + (26*b)/3) - ta 
n(c/2 + (d*x)/2)^5*((11*a)/4 - (26*b)/3))/(d*(4*tan(c/2 + (d*x)/2)^2 + 6*t 
an(c/2 + (d*x)/2)^4 + 4*tan(c/2 + (d*x)/2)^6 + tan(c/2 + (d*x)/2)^8 + 1))